package com.ymatou.iapi.godmch.testcase;

import java.util.List;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.dguser.parameter.UserCreateBean;
import com.ymatou.iapi.godmch.parameter.applySupplierBean;
import com.ymatou.iapi.godmch.parameter.createIndepMchBean;
import com.ymatou.iapi.godmch.parameter.createmchBean;
import com.ymatou.iapi.godmch.parameter.editmchBean;
import com.ymatou.iapi.godmch.parameter.getShareConfigParamBean;
import com.ymatou.iapi.godmch.parameter.setShareTypeBean;
import com.ymatou.iapi.godmch.service.applyAgentCall;
import com.ymatou.iapi.godmch.service.applySupplierCall;
import com.ymatou.iapi.godmch.service.createIndepMchCall;
import com.ymatou.iapi.godmch.service.getShareConfigParamCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.DGUserCallService;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
/**
*获取店铺分享配置和参数
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_getShareConfigParam{
	private static getShareConfigParamBean bean;
	private static getShareConfigParamCall call;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取店铺分享配置和参数");
	}

	@Before
	public void caseUp() {
		bean=new getShareConfigParamBean();
		call=new getShareConfigParamCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_getShareConfigParam_001() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是平台渠道-H5分享");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			//设置分享为H5
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(userId_channl);
			setShareTypeBean.setMchShareType(2);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			bean.setUserId(userId_channl);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(true, call.getUserId()>0, "验证userId");
			Logger.verifyEquals(false, call.getMiniApp(), "验证MiniApp");
			Logger.verifyEquals(true, call.getWxToken().length()>0, "验证WxToken");
			Logger.verifyEquals(true, call.getH5Domain().length()>0, "验证H5Domain");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_getShareConfigParam_001_3() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是平台渠道-4：独立h5");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			//设置分享为H5
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(userId_channl);
			setShareTypeBean.setMchShareType(4);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			bean.setUserId(userId_channl);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(true, call.getUserId()>0, "验证userId");
			Logger.verifyEquals(false, call.getMiniApp(), "验证MiniApp");
			Logger.verifyEquals(true, call.getWxToken().length()>0, "验证WxToken");
			Logger.verifyEquals(true, call.getH5Domain().length()>0, "验证H5Domain");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_getShareConfigParam_001_1() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是平台渠道-小程序分享");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			//设置分享为H5
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(userId_channl);
			setShareTypeBean.setMchShareType(1);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			setShareTypeBean.setPayMode(1);
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			
			bean.setUserId(userId_channl);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(true, call.getUserId()>0, "验证userId");
			Logger.verifyEquals(true, call.getMiniApp(), "验证MiniApp");
			Logger.verifyEquals(true, call.getWxToken().length()>0, "验证WxToken");
			Logger.verifyEquals(true, call.getH5Domain().length()>0, "验证H5Domain");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_getShareConfigParam_001_2() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是平台渠道-继承版小程序分享(需要开发手动配置token)");
		////平台渠道 继承版小程序 需要上级，独立商户继承版有appSource和terminalSource 可以获取token
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			//设置分享为H5
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(userId_channl);
			setShareTypeBean.setMchShareType(5);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			
			bean.setUserId(userId_channl);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			//未能获取到用户微信token，userId 500672412
			
			//Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	//@Ignore
	public void Tc_getShareConfigParam_001_4() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是独立商户渠道-继承版小程序分享(测试时appSource和terminalSource这两个值不对，所以token拿不到,需要业务测试)");
		////平台渠道 继承版小程序 需要上级，独立商户继承版有appSource和terminalSource 可以获取token
		//20200509 修改 独立小程序分别使用各自的token，其他都是使用主商户token
		try {
//			//独立商户
//			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
//			createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
//			//代理
//			applyAgentCall applyAgentCall=GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
//			//设置分享为H5
//			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(createIndepMchCall.getmchId());
//			setShareTypeBean.setMchShareType(3);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
//			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
//			Thread.sleep(5000);
//			bean.setUserId(applyAgentCall.getAgentId());
			bean.setUserId(500908529);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			//未能获取到用户微信token，userId 500672412
			
			//Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	//@Ignore
	public void Tc_getShareConfigParam_001_4_1() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是独立商户渠道-继承版小程序分享(测试时appSource和terminalSource这两个值不对，所以token拿不到,需要业务测试)");
		////平台渠道 继承版小程序 需要上级，独立商户继承版有appSource和terminalSource 可以获取token
		//20200509 修改 独立小程序分别使用各自的token，其他都是使用主商户token  供货商
		try {
//			//独立商户
//			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
//			createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
//			//代理
//			applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
//			applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
//			
//			GodmchManageCallService.approveSupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
//			//设置分享为H5
//			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(createIndepMchCall.getmchId());
//			setShareTypeBean.setMchShareType(3);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
//			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			//.sleep(5000);
			
		//	bean.setUserId(applyAgentCall.getAgentId());
			bean.setUserId(500908535);
			call.setData(bean);
			call.callService();			
//			
//			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
//			//未能获取到用户微信token，userId 500672412
//			
//			//Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_getShareConfigParam_002() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是平台渠道代理-1：小程序");
		try {
						
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			//代理
			usercreateBean1=DGUserCallService.initUsercreateBean();
			int userId_agent=DGUserCallService.UserCreateCall(usercreateBean1);
			
			//创建代理
			List<createmchBean> createmchList=GodmchManageCallService.InitcreatemchBeanForAgent(userId_channl, userId_agent);
			GodmchManageCallService.createmchCallForAgent(createmchList.toArray(new
					createmchBean[createmchList.size()]));
			editmchBean editmchbean2 = GodmchManageCallService.IniteditmachBean(userId_agent);
			GodmchManageCallService.editmachCall(editmchbean2);
			
			//设置分享为小程序
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(userId_agent);
			setShareTypeBean.setMchShareType(1);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			setShareTypeBean.setPayMode(1);
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			
			bean.setUserId(userId_agent);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(true, call.getUserId()>0, "验证userId");
			Logger.verifyEquals(true, call.getMiniApp(), "验证MiniApp");
			Logger.verifyEquals(true, call.getWxToken().length()>0, "验证WxToken");
			Logger.verifyEquals(true, call.getH5Domain().length()>0, "验证H5Domain");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_getShareConfigParam_003() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是独立商户-2:H5(测试时appSource和terminalSource这两个值不对，所以token拿不到,需要业务测试)");
		try {
			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
			createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
			//代理
			applyAgentCall applyAgentCall=GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
			//设置分享为H5
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(createIndepMchCall.getmchId());
			setShareTypeBean.setMchShareType(2);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			Thread.sleep(5000);
			bean.setUserId(createIndepMchCall.getmchId());
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_getShareConfigParam_004() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是独立商户的代理2:H5(测试时appSource和terminalSource这两个值不对，所以token拿不到,需要业务测试)");
		try {
			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
			createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
			//代理
			applyAgentCall applyAgentCall=GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
			//设置分享为H5
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(createIndepMchCall.getmchId());
			setShareTypeBean.setMchShareType(2);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			Thread.sleep(5000);
			bean.setUserId(applyAgentCall.getAgentId());
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_getShareConfigParam_005() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是平台渠道客服-商户设置1：小程序 ");
		try {
			
			Integer mchId=GodmchManageCallService.CreateSellerMch();
	        UserCreateBean usercreateBean= DGUserCallService.initCsUsercreateBean();
			//设置分享为H5
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(mchId);
			setShareTypeBean.setMchShareType(1);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			setShareTypeBean.setPayMode(1);
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			
	        Integer csId=DGUserCallService.UserCreateCall(usercreateBean);
			GodmchManageCallService.CreateCSCall( mchId, csId, 4);
			
			bean.setUserId(csId);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(true, call.getUserId()>0, "验证userId");
			Logger.verifyEquals(true, call.getMiniApp(), "验证MiniApp");
			Logger.verifyEquals(true, call.getWxToken().length()>0, "验证WxToken");
			Logger.verifyEquals(true, call.getH5Domain().length()>0, "验证H5Domain");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_getShareConfigParam_005_1() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是平台渠道客服-商户设置2：H5 ");
		try {
			
			Integer mchId=GodmchManageCallService.CreateSellerMch();
	        UserCreateBean usercreateBean= DGUserCallService.initCsUsercreateBean();
			//设置分享为H5
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(mchId);
			setShareTypeBean.setMchShareType(2);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			
	        Integer csId=DGUserCallService.UserCreateCall(usercreateBean);
			GodmchManageCallService.CreateCSCall( mchId, csId, 4);
			
			bean.setUserId(csId);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(true, call.getUserId()>0, "验证userId");
			Logger.verifyEquals(false, call.getMiniApp(), "验证MiniApp");
			Logger.verifyEquals(true, call.getWxToken().length()>0, "验证WxToken");
			Logger.verifyEquals(true, call.getH5Domain().length()>0, "验证H5Domain");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_getShareConfigParam_005_2() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是平台渠道代理客服-商户设置2：H5 ");
		try {
			
			Integer userId_channl=GodmchManageCallService.CreateSellerMch();
	        UserCreateBean usercreateBean= DGUserCallService.initCsUsercreateBean();
	    	//代理
			usercreateBean=DGUserCallService.initUsercreateBean();
			int userId_agent=DGUserCallService.UserCreateCall(usercreateBean);
			//创建代理
			List<createmchBean> createmchList=GodmchManageCallService.InitcreatemchBeanForAgent(userId_channl, userId_agent);
			GodmchManageCallService.createmchCallForAgent(createmchList.toArray(new
					createmchBean[createmchList.size()]));
			editmchBean editmchbean2 = GodmchManageCallService.IniteditmachBean(userId_agent);
			GodmchManageCallService.editmachCall(editmchbean2);
			
			//设置分享为H5
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(userId_agent);
			setShareTypeBean.setMchShareType(2);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			
			usercreateBean=DGUserCallService.initUsercreateBean();
	        Integer csId=DGUserCallService.UserCreateCall(usercreateBean);
			GodmchManageCallService.CreateCSCall( userId_agent, csId, 4);
			
			bean.setUserId(csId);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(true, call.getUserId()>0, "验证userId");
			Logger.verifyEquals(false, call.getMiniApp(), "验证MiniApp");
			Logger.verifyEquals(true, call.getWxToken().length()>0, "验证WxToken");
			Logger.verifyEquals(true, call.getH5Domain().length()>0, "验证H5Domain");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_getShareConfigParam_005_3() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是平台渠道代理客服-商户设置1：小程序 ");
		try {
			
			Integer userId_channl=GodmchManageCallService.CreateSellerMch();
	        UserCreateBean usercreateBean= DGUserCallService.initCsUsercreateBean();
	    	//代理
			usercreateBean=DGUserCallService.initUsercreateBean();
			int userId_agent=DGUserCallService.UserCreateCall(usercreateBean);
			//创建代理
			List<createmchBean> createmchList=GodmchManageCallService.InitcreatemchBeanForAgent(userId_channl, userId_agent);
			GodmchManageCallService.createmchCallForAgent(createmchList.toArray(new
					createmchBean[createmchList.size()]));
			editmchBean editmchbean2 = GodmchManageCallService.IniteditmachBean(userId_agent);
			GodmchManageCallService.editmachCall(editmchbean2);
			
			//设置分享为H5
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(userId_agent);
			setShareTypeBean.setMchShareType(1);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			setShareTypeBean.setPayMode(1);
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			
			usercreateBean=DGUserCallService.initUsercreateBean();
	        Integer csId=DGUserCallService.UserCreateCall(usercreateBean);
			GodmchManageCallService.CreateCSCall( userId_agent, csId, 4);
			
			bean.setUserId(csId);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(true, call.getUserId()>0, "验证userId");
			Logger.verifyEquals(true, call.getMiniApp(), "验证MiniApp");
			Logger.verifyEquals(true, call.getWxToken().length()>0, "验证WxToken");
			Logger.verifyEquals(true, call.getH5Domain().length()>0, "验证H5Domain");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
    @Ignore
	public void Tc_getShareConfigParam_006() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是独立商户客服,(测试时appSource和terminalSource这两个值不对，所以token拿不到,需要业务测试)");
		try {
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
			createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
			//设置分享为H5
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(createIndepMchCall.getmchId());
			setShareTypeBean.setMchShareType(1);//1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			
			UserCreateBean usercreateBean= DGUserCallService.initCsUsercreateBean();
	        Integer csId=DGUserCallService.UserCreateCall(usercreateBean);
			GodmchManageCallService.CreateCSCall( createIndepMchCall.getmchId(), csId, 4);
			
			bean.setUserId(csId);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(true, call.getUserId()>0, "验证userId");
			Logger.verifyEquals(false, call.getMiniApp(), "验证MiniApp");
			Logger.verifyEquals(true, call.getWxToken().length()>0, "验证WxToken");
			Logger.verifyEquals(true, call.getH5Domain().length()>0, "验证H5Domain");		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_getShareConfigParam_007() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是普通用户");
		try {
			UserCreateBean usercreateBean= DGUserCallService.initCsUsercreateBean();
	        Integer userId=DGUserCallService.UserCreateCall(usercreateBean);
	        bean.setUserId(userId);
			call.setData(bean);
			call.callService();			
			Logger.verifyEquals("5000", call.getStatusCode1(), "验证status");
			//Logger.verifyEquals(true, call.getMessage().contains("根据userId未查询到商户或者客服信息"), "验证Message");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_getShareConfigParam_008() {
		Logger.start(true,"正例-获取店铺分享配置和参数-userId是不存在的用户");
		try {
			bean.setUserId(99999);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("5000", call.getStatusCode1(), "验证status");
			//Logger.verifyEquals(true, call.getMessage().contains("根据userId未查询到商户或者客服信息"), "验证Message");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}